const { defineConfig } = require('@vue/cli-service')
const path = require('path');

const packageName = 'vue3'
const port =9005
module.exports = defineConfig({
  transpileDependencies: true,
  assetsDir: 'static',
  outputDir: 'dist',
  filenameHashing:true,
  publicPath:'http://localhost:9005',
  devServer: {
    open: true,
    hot: true,
    port,
    headers: {
      "Access-Control-Allow-Origin": "*", // 主应用获取子应用时跨域响应头
    },
  },
  chainWebpack: config =>{
    config.output
    .library(packageName)
    .libraryTarget('umd');
    
      // 添加别名
      config.resolve.alias
      .set('@', path.resolve(__dirname, 'src'));
    }

})
